package com.github.lock;

import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;

/**
 * Description:
 *
 * @author zwl
 * @version 1.0
 * @date 2021/8/21 上午11:29
 */
public class Test {

    public static void main(String[] args) throws InterruptedException {

        LinkedList<Object> list = new LinkedList<>();

        list.peek();

        Thread thread = new Thread(() -> {

            System.out.println("park...");

            LockSupport.park();

            System.out.println("unpark...");

        });
        thread.start();

        TimeUnit.SECONDS.sleep(3);

        thread.interrupt();

        System.out.println("interrupt thread");
    }

}
